app.service('systemConfigService',['$http','$q','utilService',function($http,$q,utilService){

    var _this_=this;

    _this_.find = function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'system/config'
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        });
        return deferred.promise;
    }


    _this_.systemConfigEditVO={};
    _this_.update = function($scope){
        var deferred = $q.defer();
        utilService.api({
            url:$scope.app.domain + 'system/config',
            data:_this_.systemConfigEditVO,
            method:'PUT'
        }).then(function(result){
            deferred.resolve(result);
        });
        return deferred.promise;
    }


}]);